<!--
 * @Author: zzy zhangzeyang@huidr.com
 * @Date: 2025-02-24 14:38:28
 * @LastEditors: zzy zhangzeyang@huidr.com
 * @LastEditTime: 2025-03-25 10:53:11
 * @FilePath: \about_vue\src\views\home\HomePage1.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="list-container">
        <van-list @load="loadData" v-model:loading="loading" finished-text="没有更多了" :finished="finished" :offset="500">
            <van-cell v-for="item in list" :key="item.id" :title="item.title" :value="item.value" @click="clickItem(item)" />
        </van-list>
    </div>
    
</template>

<script setup>
    import {ref} from 'vue'
    import {useRouter,useRoute} from 'vue-router';
    const router=useRouter();
    const route=useRoute();

    const list=ref([
        {title:"订单列表",path:"/orderList",value:1},
        {title:"疾病",path:"/DiseaseManagement",value:1},
        {title:"疾病筛选",path:"/DisFilterView",value:1},
        
    ]);
    const loading=ref(false);
    const finished=ref(false);

    const loadData=function(){
        console.log("loadData-1--",loading.value)
        // if(list.value.length>=300){
        //     finished.value=true;
        //     loading.value=false;
        //     return;
        // }
        // for(let i=0;i<25;i++){
        //     list.value.push({title:"订单列表",path:"/orderList",value:list.value.length+1});
        // }
        loading.value=false;
        console.log("loadData-2--",loading.value)
    }
    const clickItem=function(item){
        console.log("clickItem--",item)
        router.push({path:item.path});
    }
</script>

<style scoped>
.list-container {
    width: 100%;
    height: 100vh;
    background: #c9c9c9;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch; /* 增加iOS滚动支持 */
}
</style>